home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Demos / Commander Demo / Commander 2.0.1 Demo / Commander 2.0.1 Demo.rsrc / TEXT_5554_LOAD COMPRESS PICTURE.txt < prev    next >
Encoding:
Text File  |  1994-08-15  |  1.9 KB  |  32 lines

  1. LOAD¬†COMPRESS¬†PICTURE¬†FROM¬†FILE(docRef; method; quality;picture)
  2.                                                                                  [4D 3.1 Upgrade]
  3.  
  4. docRef        Docref       Document reference 
  5. method       String        Compression method (4 characters)
  6. quality       Integer       Compression quality
  7. picture       Picture      Compressed picture
  8.  
  9.  
  10. This command compresses a picture loaded from a document on disk.
  11.  
  12. You can open a PICT document using the Open document function. You can then use the document reference returned by this function to load and compress the PICT found in the document. This command loads the picture into memory, compresses it using the method and quality you have specified, and then returns it into the fourth parameter. The picture is loaded into memory before it is compressed. If there is not enough memory to load the picture, use COMPRESS¬†PICTURE¬†FILE before calling LOAD COMPRESS PICTURE FROM FILE.
  13.  
  14. DocRef is a document reference returned from Open¬†document.
  15.  
  16. Method is a 4-character string indicating the compressor type (for more information, see ‚ÄúQuickTime Compressor Types‚Äù in the 4D Reference Command Set).
  17.  
  18. Quality is an integer between 1 and 1000 indicating the quality of the compressed picture. In general, reducing the quality will allow for greater compression of the picture.
  19.  
  20.  
  21. WARNING: The ratio of compression possible for a given quality depends on the size and the nature of the picture you are compressing. Compressing small pictures may not produce any decrease in size.
  22.  
  23.  
  24. The following example presents an Open File dialog box that allows you to select a PICT file. The picture in the PICT file is loaded into memory, compressed, stored in a picture variable, and then the file is closed.
  25.  
  26. vRef:=Open document (‚Äú‚Äú;"PICT")
  27. If(OK=1)
  28.   LOAD COMPRESS PICTURE FROM FILE(vRef;''jpeg'';500;Picture)
  29.   CLOSE DOCUMENT(vRef)
  30. End if
  31.  
  32.